package top.mengchaob.deploy.table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import top.mengchaob.fileserver.netty.table.FileDo;

import javax.persistence.*;

/**
 * @title：服务器信息表
 * @author: mengchaob
 * @date: 2021年04月27日 15:04
 * @description:
 */
@Entity
@Table(name = "host_server_info")
public class HostServerDO {
    @Id
    @Column(length = 64)
    private String id;
    @Column(length = 64)
    private String hostId;
    @JoinColumn(name = "hostId",referencedColumnName = "id",insertable = false,updatable = false,foreignKey = @ForeignKey(name ="none",value = ConstraintMode.NO_CONSTRAINT))//级联操作分离
    @OneToOne(targetEntity = HostDo.class)
    @NotFound(action= NotFoundAction.IGNORE)
    private HostDo hostDo;
    @Column(length = 20)//yyyy-mm-dd hh24:mi:ss
    private String createTime;
    @Column(length = 10)
    private int timeOut;
    @Column(length = 1000)
    private String beforeCmdLocal;
    @Column(length = 1000)
    private String beforeCmdRemote;
    @Column(length = 1000)
    private String afterCmdLocal;
    @Column(length = 1000)
    private String afterCmdRemote;
    @Column(length = 60)
    private String serverName;
    @Column(length = 500)
    private String mark;
    @Column(length = 64)
    private String fileId;
    @JoinColumn(name = "fileId",referencedColumnName = "fileId",insertable = false,updatable = false,foreignKey = @ForeignKey(name ="none",value = ConstraintMode.NO_CONSTRAINT))//级联操作分离
    @OneToOne(targetEntity = FileDo.class)
    @NotFound(action= NotFoundAction.IGNORE)
    private FileDo fileDo;

    @Column(length = 500)
    private String fileRemoteAddr;
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getHostId() {
        return hostId;
    }

    public void setHostId(String hostId) {
        this.hostId = hostId;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getTimeOut() {
        return timeOut;
    }

    public void setTimeOut(int timeOut) {
        this.timeOut = timeOut;
    }

    public String getBeforeCmdLocal() {
        return beforeCmdLocal;
    }

    public void setBeforeCmdLocal(String beforeCmdLocal) {
        this.beforeCmdLocal = beforeCmdLocal;
    }

    public String getBeforeCmdRemote() {
        return beforeCmdRemote;
    }

    public void setBeforeCmdRemote(String beforeCmdRemote) {
        this.beforeCmdRemote = beforeCmdRemote;
    }

    public String getAfterCmdLocal() {
        return afterCmdLocal;
    }

    public void setAfterCmdLocal(String afterCmdLocal) {
        this.afterCmdLocal = afterCmdLocal;
    }

    public String getAfterCmdRemote() {
        return afterCmdRemote;
    }

    public void setAfterCmdRemote(String afterCmdRemote) {
        this.afterCmdRemote = afterCmdRemote;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getFileRemoteAddr() {
        return fileRemoteAddr;
    }

    public void setFileRemoteAddr(String fileRemoteAddr) {
        this.fileRemoteAddr = fileRemoteAddr;
    }

    public HostDo getHostDo() {
        return hostDo;
    }

    public void setHostDo(HostDo hostDo) {
        this.hostDo = hostDo;
    }

    public FileDo getFileDo() {
        return fileDo;
    }

    public void setFileDo(FileDo fileDo) {
        this.fileDo = fileDo;
    }
}
